import React, { Component, component } from 'react'
import { Switch, Route} from 'react-router-dom'
// 路由懒加载
import Loadable from 'react-loadable';
// 路由懒加载-加载过程中显示的组件
import Loading from './components/Loading';

// import Blog from './components/Blog'
// import ComFather from './components/ComFather'
// import ComC from './components/ComC'

const Blog = Loadable({
    loader: () => import('./components/Blog'),
    loading: Loading,
});
const ComFather = Loadable({
    loader: () => import('./components/ComFather'),
    loading: Loading,
});
const ComC = Loadable({
    loader: () => import('./components/ComC'),
    loading: Loading,
});
const Big = Loadable({
    loader: () => import('./components/Big'),
    loading: Loading,
});
const GoodsList = Loadable({
    loader: () => import('./components/GoodsList'),
    loading: Loading,
    
});
const GoodsDetail = Loadable({
    loader: () => import('./components/GoodsDetail'),
    loading: Loading,
    
});
const AntTable = Loadable({
    loader: () => import('./components/AntTable'),
    loading: Loading,
    
});
const AntForm = Loadable({
    loader: () => import('./components/AntForm'),
    loading: Loading,
    
});

export default class Router extends Component {
    render() {
        return (
            <Switch>
                {/* exact严格匹配 */}
                <Route path='/index' exact component={ComC} />
                <Route path='/Blog' component={Blog} />
                <Route path='/ComFather' component={ComFather} />
                <Route path='/big' component={Big} />
                <Route path='/goodslist' component={GoodsList} />
                <Route path='/GoodsDetail/:name' component={GoodsDetail} />
                <Route path='/table' component={AntTable} />
                <Route path='/form' component={AntForm} />
            </Switch>
        )
    }
}